package main

import (
	"os"
	"net/http"
	"git.oschina.net/YPTArch/auth/sys/logs"
	"git.oschina.net/YPTArch/auth/sys/router"
	"git.oschina.net/YPTArch/auth/sys/config"
	"git.oschina.net/YPTArch/auth/sys/redis"
)

func init()  {
	//日志
	logs.NewLog()
	//配置
	config.Conf = new(config.Config)
	if err := config.LoadConfig(); err != nil {
		os.Exit(1)
	}
	//redis
	redis.InitRedis()
}


func main() {
	router.InitRouter()
	err := http.ListenAndServe(config.Conf.ServerBind, nil) //设置监听的端口
	if err != nil {
		logs.Logger.Panic("ListenAndServe: " + err.Error())
		os.Exit(1)
	}
}

